﻿<%@ Page Title="" Language="C#" ClientIDMode="Static" MasterPageFile="~/User/User.Master" AutoEventWireup="true" CodeBehind="MenuEdit.aspx.cs" Inherits="CoolERP_Web.User.MenuEdit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../Scripts/lhgdialog/lhgcore.min.js" type="text/javascript"></script>
<script language=javascript>
    var DG = frameElement.lhgDG;
    $(function () {
        if (isEmpty($("#ddlParent").val()))
            $("#trUrl").hide();
        else
            $("#trUrl").show();
    });
    function setParent(id) {
        if (isEmpty(id))
            $("#trUrl").hide();
        else
            $("#trUrl").show();
    }
    function checkSubmit() {
        if (isEmpty($("#txtCode").val())) {
            alert("请输入编码");
            return false;
        }
        if (isEmpty($("#txtName").val())) {
            alert("请输入名称");
            return false;
        }
        if (!isEmpty($("#ddlParent").val()) && isEmpty($("#txtUrl").val())) {
            alert("请输入链接地址");
            return false;
        }
        return true;
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class=tbHead_L></td>
        <td class=tbHead_M></td>
        <td class=tbHead_R></td>
    </tr>
    <tr>
        <td class=tbBody_L></td>
        <td class=tbBody_M>
        <table border="0" cellpadding=5 cellspacing=0>
            <tr>
                <td width=60px>父级菜单：</td>
                <td><asp:DropDownList ID="ddlParent" runat=server onchange="setParent(this.value)"></asp:DropDownList></td>
            </tr>
            <tr>
                <td>编码：</td>
                <td><asp:TextBox ID="txtCode" runat="server" CssClass="textbox" MaxLength="10"></asp:TextBox> *</td>
            </tr>
            <tr>
                <td>名称：</td>
                <td><asp:TextBox ID="txtName" runat="server" CssClass="textbox" MaxLength="10"></asp:TextBox> *</td>
            </tr>
            <tr id="trUrl">
                <td>链接地址：</td>
                <td><asp:TextBox ID="txtUrl" runat="server" CssClass="textbox" MaxLength="64"></asp:TextBox> *</td>
            </tr>
            <tr>
                <td>状态：</td>
                <td><asp:RadioButtonList ID="rblEnable" RepeatDirection=Horizontal runat="server">
                    <asp:ListItem Value="1" Selected=True>启用</asp:ListItem><asp:ListItem Value="0">禁用</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>排序：</td>
                <td><asp:TextBox ID="txtSort" runat="server" CssClass="textbox" MaxLength="4" Width=30px onkeyup='txtLimit(this,0)'></asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/Common/btn_save0.png" OnClick="btnSave_Click" OnClientClick="return checkSubmit();" />&nbsp;&nbsp;
                <input type=image src="../Images/Common/btn_close.png" onclick="DG.cancel();" />&nbsp;&nbsp;
                <asp:Label ID="labResult" runat="server" ForeColor="Red"></asp:Label></td>
            </tr>
        </table>
        </td>
        <td class=tbBody_R></td>
    </tr>
    <tr>
        <td class=tbFoot_L></td>
        <td class=tbFoot_M></td>
        <td class=tbFoot_R></td>
    </tr>
</table>
</asp:Content>
